#include "gui/layers/Layer.h"

namespace gui {

Layer::Layer() {
	this->completeSurface = new Surface(1, 1, 0, 0, 0);
	this->offset.x = 0;
	this->offset.y = 0;
}

Layer::~Layer() {
	delete this->completeSurface;
}

Surface* Layer::getPortion(Portion portion) {
	Surface* ret = new Surface(*this->completeSurface);
	portion.x -= this->offset.x;
	portion.y -= this->offset.y;
	ret->crop(portion);
	return ret;
}

}
